import requests
from lxml import etree

url = "https://www.zbj.com/fw/?k=web"
resp = requests.get(url)
resp.encoding = "utf-8"
html_content = resp.text

html = etree.HTML(html_content)
## //*[@id="__layout"]/div/div[3]/div[1]/div[4]/div/div[2]/div[1]/div[2]/div[1]
# divs = html.xpath('//*[@id="__layout"]/div/div[3]/div[1]/div[4]/div/div[2]/div[1]/div[2]/div')
divs = html.xpath("/html/body/div/div/div/div[3]/div[1]/div[4]/div/div[2]/div[1]/div[2]/div[@class='service-card-wrap']")
print(divs.__len__())
for div in divs:
    price = div.xpath("./div/div[3]/div[1]/span/text()")[0].strip("¥")
    title = div.xpath("./div/div[3]/div[2]/a/span/text()")[0]
    print(price,title)